﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RMS.Utils.MVP;
using RMS.Web.Shell.View;
using RMS.DataAccess.Entities;
using RMS.DataAccess.Repositories;
using RMS.Utils.Authentication;
using RMS.DataAccess.Common;

namespace RMS.Web.Shell.Presenter
{
    public class GetRadiologyRequestPresenter : Presenter<IGetRadiologyRequestView>
    {
        TechnicianRadiologyRequestsDtoRepository _technicianRadiologyRequestsDtoRepository;
        IAuthentication _authentication;
        RadiologyRequestRepository _radiologyRequestRepository;

        public GetRadiologyRequestPresenter(TechnicianRadiologyRequestsDtoRepository technicianRadiologyRequestsDtoRepository,
          RadiologyRequestRepository radiologyRequestRepository, IAuthentication authentication)
        {
            _technicianRadiologyRequestsDtoRepository = technicianRadiologyRequestsDtoRepository;
            _radiologyRequestRepository = radiologyRequestRepository;
            _authentication = authentication;
        }
        public EntityResult<TechnicianRadiologyRequestsDto> GetRequests(int startIndex, int lenght)
        {
            return _technicianRadiologyRequestsDtoRepository.Find(item =>
            {
                item.TechnicianID = _authentication.CurrentLogedInMember.Id;
                item.RequestStatues = false;
            }, TechnicianRadiologyRequestsDtoColumns.RequestDate, startIndex, lenght);
        }

        
    }
}
